/*
 * XtrazForm.java
 *
 * Created on 15 ���� 2007 �., 22:58
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

// #sijapp cond.if protocols_ICQ is "true" #
// #sijapp cond.if modules_XSTATUSES is "true" #
package jimm.forms;

import jimm.ui.form.*;
import protocol.icq.*;

import javax.microedition.lcdui.*;

/**
 *
 * @author vladimir
 */
public final class IcqXStatusForm extends SomeXStatusForm implements FormListener {
    private GraphForm form;
    private static final int OPTION_XTRAZ_TITLE = 10;
    private static final int OPTION_XTRAZ_DESC  = 11;

    public IcqXStatusForm(Icq protocol) {
        super(protocol);
    }

    private void showXtrazForm() {
        int id = xstatus;
        form = new GraphForm("set_xstatus", "save", "back", this);
        form.addTextField(OPTION_XTRAZ_TITLE, "xtraz_title", xst_titles[id], 32, TextField.ANY);
        form.addTextField(OPTION_XTRAZ_DESC, "xtraz_desc", xst_descs[id], 100, TextField.ANY);
        form.show();
    }
    
    public void formAction(GraphForm form, boolean apply) {
        if (apply) {
            setXStatus(form.getTextFieldValue(OPTION_XTRAZ_TITLE),
                    form.getTextFieldValue(OPTION_XTRAZ_DESC));
        }
        back();
    }

    /**************************************************************************/
    
    protected void onStatusSelected() {
        showXtrazForm();
    }
}
// #sijapp cond.end #
// #sijapp cond.end #
